; *** Coins
; *** Copyright 1998-2003 Zillions Development
; v.2.0.1

; You need to purchase Zillions of Games to load this rules file
; Visit the Zillions web site at http://www.zillions-of-games.com

(version "2.0")
(translate
 ("Player-1" "玩家1") ("Player-2" "玩家2")
 ("Coin" "硬币")
)

(game
    (title "移硬币一")
	(description "双方轮流移动硬币，可以向左移动任意格，不能跳过其他硬币。无法移动者输。")
	(history "This is a series of basic games, one of which was invented by Welter.
	   From the book `Combinatorial Games` and the book `On Numbers and Games`
           by John Conway (New York Academic Press, Inc., 1976).")
 	(strategy "When you have the option of moving more than one position to the left,
       try sliding as far as possible to leave your opponent fewer moves.")
    (option "prevent flipping" true)
    (option "animate drops" false)
    (opening-sound "Audio\\Register.wav")
    (move-sound "Audio\\Slide.wav")
    (click-sound "Audio\\Click.wav")
    (release-sound "Audio\\CoinDrop.wav")
    (players Player-1 Player-2 Neutral)
    (turn-order (Player-1 Neutral) (Player-2 Neutral))
    (board
        (image "images\Coins\SHaag\7bd.bmp" "images\Coins\7bd.bmp")
        (grid
            (start-rectangle 7 10 85 89)
            (dimensions ;single line
                ("a/b/c/d/e/f/g" (79 0)) ;columns
			)
			(directions (w -1))
		)
    )
    (board-setup
        (Neutral (Coin c d f g))
    )
    (piece
        (image Neutral "images\Coins\SHaag\heads.bmp" "images\Coins\heads.bmp")
        (description "硬币可以向左移动，无限格数。")
        (help "硬币：向左移动，格数不限。")
        (name Coin)
        (moves
            (w (while empty? add w) )
        )		
    )
    (loss-condition (Player-1 Player-2) stalemated)
)

(variant
   (title "移硬币二")
   (board-setup
      (Neutral (Coin  e f g))
   )
)


(variant (title "-"))

(define Welter
   (description "双方轮流移动硬币，可以向左移动任意格，可以跳过其他硬币。无法移动者输。"); 
   (history "This game is named for C.P. Welter, who discovered some general properties
             of the game in the 1950's.   It is one of many interesting variants of Nim.")
   (strategy "You can discover some of the moves which work by experimentation.  Zillions
            is a ruthless opponent, of course, and will win if you make the slightest
            mistake.  To find out how to win, see `Winning Ways` by Conway, Berlekamp,
            and Guy, or `Fair Game` by Richard K. Guy.")
   (piece
            (image Neutral "images\Coins\SHaag\heads.bmp" "images\Coins\heads.bmp")
            (name Coin)
			(help "Coin: slides any number of squares to the left, jumps allowed")
			(moves
		       (w (while empty? add w) w (while empty? add w) w (while empty? add w) w
			      (while empty? add w))
			)		
   )
)

(variant
   (title "跳跃硬币一")
   (Welter)
   (board-setup
      (Neutral (Coin c e g))
   )
)

(variant
   (title "跳跃硬币二")
   (Welter)
   (board-setup
      (Neutral (Coin d f g))
   )
)


(variant (title "-"))

(define Turning
    (description "先把所有硬币翻成反面朝上（鹰图案）的胜利。双方每回合必须翻转一个正面朝上（人头）的硬币，然后可以选择一个它左边的一个正面朝上的硬币翻转。反面朝上的硬币不可翻转。\汉化组：此程序的bug已修复。")
    (history "`Turning` is a game (with two different opening setups) from the book
        `Combinatorial Games.`  It is based on an idea by the Dutch number theorist,
        Hendrik William Lenstra.")
    (strategy "You can discover some of the moves which work by experimentation.
        To get a complete description of how to win, see `Winning Ways` by Conway,
        Berlekamp, and Guy, or `Fair Game` by Richard K. Guy, where the game is
        described under the name `Turning Turtles`.   The first variant is a loss
        for the first player with best play; the second variant is a win for the
        first player.")
    (drop-sound "Audio\\CoinDrop.wav")
    (change-sound "Audio\\CoinDrop.wav")
    (capture-sound "")
    (piece
        (image Neutral "images\Coins\SHaag\heads.bmp" "images\Coins\heads.bmp")
        (description "硬币正面朝上，你可以翻转它，然后可以再翻转一个它左边的正面朝上的硬币")
        (help "硬币正面朝上，你可以翻转它，然后可以再翻转一个它左边的正面朝上的硬币")
        (name Heads)		
    )
    (piece
        (image Neutral "images\Coins\SHaag\tails.bmp" "images\Coins\tails.bmp")
        (description "硬币反面朝上，不能翻转。")
        (help "硬币反面朝上，不可翻转。")
        (name Tails)
        (drops (
			(verify (piece? Heads)) add
			(if (piece? Tails w) w (change-type Heads) (opposite w) add)
			(if (piece? Heads w) w (change-type Tails) (opposite w) add) )
        )			
    )
    (win-condition (Neutral)
	  	(absolute-config Tails (a b c d e f g))
    )
)

(variant
    (title "翻硬币一")
    (Turning)
    (board-setup
        (Neutral (Heads c d f g off 99)
                 (Tails a b e off 99)
        )
    )
)

(variant
    (title "翻硬币二")
    (Turning)
    (board-setup
        (Neutral (Heads c f g off 99)
                 (Tails a b d e off 99)
        )
    )
)
